package com.zzt.appframe8

import android.content.Context
import android.content.Intent
import android.nfc.Tag
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.Button
import com.zzt.appframe8.widget.MTextInputLayout

class SSSSS : AppCompatActivity() {
    companion object {
        val TAG = SSSSS::class.java.simpleName

        @JvmStatic
        fun start(context: Context) {
            val starter = Intent(context, SSSSS::class.java)
            context.startActivity(starter)
        }
    }

    var mtil_test3: MTextInputLayout? = null
    var btn_show: Button? = null
    var btn_hide: Button? = null
    var btn_enable: Button? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_sssss)
        mtil_test3 = findViewById(R.id.mtil_test3)
        btn_show = findViewById(R.id.btn_show)
        btn_hide = findViewById(R.id.btn_hide)
        btn_enable = findViewById(R.id.btn_enable)


        btn_show?.setOnClickListener {
            mtil_test3?.setError("ssssssssssssss")
        }
        btn_hide?.setOnClickListener {
            mtil_test3?.setError("")
        }
        btn_enable?.setOnClickListener {
            var enabled: Boolean = mtil_test3?.isEnabled == true
            Log.d(TAG, "是否可用：$enabled")
            val b = !enabled
            mtil_test3?.editText?.isEnabled = b
            mtil_test3?.isEnabled = b

            btn_enable?.setText("输入状态：" + mtil_test3?.isEnabled)
        }
    }
}